"""
识别汽车
"""
import matplotlib.pyplot as plt
import paddlehub as hub
import cv2
from PIL import Image

vehicles_detector = hub.Module(name="yolov3_darknet53_vehicles")
result =vehicles_detector.object_detection(images=[cv2.imread('imgs/test2.jpg')],visualization=True)

# 结果保存到
img = Image.open(result[0]['save_path'])
plt.figure(figsize=(15,8))
plt.imshow(img)
plt.show()